package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DifyAppMapper;
import com.ruoyi.system.domain.DifyApp;
import com.ruoyi.system.service.IDifyAppService;

/**
 * Dify应用配置Service业务层处理
 * 
 * @author xiaoyilala
 * @date 2025-07-22
 */
@Service
public class DifyAppServiceImpl implements IDifyAppService 
{
    @Autowired
    private DifyAppMapper difyAppMapper;

    /**
     * 查询Dify应用配置
     * 
     * @param id Dify应用配置主键
     * @return Dify应用配置
     */
    @Override
    public DifyApp selectDifyAppById(Long id)
    {
        return difyAppMapper.selectDifyAppById(id);
    }

    /**
     * 查询Dify应用配置列表
     * 
     * @param difyApp Dify应用配置
     * @return Dify应用配置
     */
    @Override
    public List<DifyApp> selectDifyAppList(DifyApp difyApp)
    {
        return difyAppMapper.selectDifyAppList(difyApp);
    }

    /**
     * 新增Dify应用配置
     * 
     * @param difyApp Dify应用配置
     * @return 结果
     */
    @Override
    public int insertDifyApp(DifyApp difyApp)
    {
        difyApp.setCreateTime(DateUtils.getNowDate());
        return difyAppMapper.insertDifyApp(difyApp);
    }

    /**
     * 修改Dify应用配置
     * 
     * @param difyApp Dify应用配置
     * @return 结果
     */
    @Override
    public int updateDifyApp(DifyApp difyApp)
    {
        difyApp.setUpdateTime(DateUtils.getNowDate());
        return difyAppMapper.updateDifyApp(difyApp);
    }

    /**
     * 批量删除Dify应用配置
     * 
     * @param ids 需要删除的Dify应用配置主键
     * @return 结果
     */
    @Override
    public int deleteDifyAppByIds(Long[] ids)
    {
        return difyAppMapper.deleteDifyAppByIds(ids);
    }

    /**
     * 删除Dify应用配置信息
     * 
     * @param id Dify应用配置主键
     * @return 结果
     */
    @Override
    public int deleteDifyAppById(Long id)
    {
        return difyAppMapper.deleteDifyAppById(id);
    }
}
